
import Vue from 'vue';
import Toast from "./Toast.vue";

const ToastCtor = Vue.extend(Toast)

export function showToast(content, delay) {
	const toastComp = new ToastCtor().$mount();
	document.body.appendChild(toastComp.$el);
	toastComp.show(content);

	setTimeout(() => {
		toastComp.hide();
		toastComp.$el.parentNode.removeChild(toastComp.$el);
	}, delay)

}
